Next | Prev | Up | Top | Contents | Index

Disassembling Object Files with dis

The dis tool disassembles object files into machine instructions. You can disassemble an object, archive library, or executable file.


dis Syntax

The syntax for dis is:

dis options filename1 [filename2...filenamen]

options One or more of the options listed in Table 2-5.

filename

Specifies the name of one or more files to disassemble.

dis Options

Table 2-5 lists dis options. For more information, see the dis(1) reference page. Click dis to view the page.

dis Options
OptionDescription
-b begin_addrStarts disassembly at begin_address. You can specify the address as decimal, octal (with a leading 0), or hexadecimal (with a leading 0x).
-d sectionDisassembles the named section as data, and prints the offset of the data from the beginning of the section.
-D sectionDisassembles the named section as data, and prints the address of the data.
-e end_addressStops disassembly at end_address. You can specify the address as decimal, octal (with a leading 0), or hexadecimal (with a leading 0x).
-F functionDisassembles the named function in each object file you specify on the command line.
-hSubstitutes the hardware register names for the software register names in the output.
-HRemoves the leading source line, and leaves the hex value and the instructions.
-iRemoves the leading source line and hexadecimal value of disassembly, and leaves only the instructions.
-I directoryUses directory to help locate source code.
-l stringDisassembles the archive file specified by string.
-LLooks up source labels for subsequent printing.
-oPrints numbers in octal. The default is hexadecimal.
-sPerforms symbolic disassembly where possible. Prints (using C syntax) symbol names on the line following the instruction. Displays source code mixed with assembly code
-t sectionDisassembles the named section as text.
-TSpecifies the trace flag for debugging the disassembler.
-VPrints (on stderr) the version number of the disassembler being executed.
-wPrints source code to the right of assembly code (produces wide output). Use this option with the -s option.
-xPrints offsets in hexadecimal (the default).


Next | Prev | Up | Top | Contents | Index